 package nc.bs.pub.action;
 
 import java.util.Hashtable;
 import nc.bs.framework.common.NCLocator;
 import nc.bs.ic.pub.util.ICBillVOQuery;
 import nc.bs.pub.compiler.AbstractCompiler2;
 import nc.bs.scmpub.pf.PfParameterUtil;
 import nc.itf.ic.m4n.ITransformMaitain;
 import nc.vo.ic.m4n.entity.TransformVO;
 import nc.vo.ml.NCLangRes4VoTransl;
 import nc.vo.pub.BusinessException;
 import nc.vo.pub.compiler.PfParameterVO;
 import nc.vo.pubapp.pattern.exception.ExceptionUtils;
 
 
 
 
 public class N_4N_WRITE
   extends AbstractCompiler2
 {
   private Hashtable m_methodReturnHas = new Hashtable();
   
   private Hashtable m_keyHas = null;
 
 
 
 
 
 
 
 
 
 
 
 
   
   public Object runComClass(PfParameterVO vo) throws BusinessException {
     try {
       this.m_tmpVo = vo;
       
       TransformVO[] bills = (TransformVO[])getVos();
       if (null != bills[0] && null != bills[0].getHead() && null != bills[0].getHead().getCspecialhid()) {
         
         PfParameterUtil<TransformVO> util = new PfParameterUtil<TransformVO>(getPfParameterVO(), bills);
         TransformVO[] originBills = (TransformVO[])util.getOrginBills();
         if (originBills == null) {
           originBills = (TransformVO[])(new ICBillVOQuery()).queryBills(bills);
         }
         TransformVO[] clientFullBills = (TransformVO[])util.getClientFullInfoBill();
         return ((ITransformMaitain)NCLocator.getInstance()
           .lookup(ITransformMaitain.class)).update(clientFullBills, originBills);
       } 
       
       return ((ITransformMaitain)NCLocator.getInstance()
         .lookup(ITransformMaitain.class)).insert(bills);
     
     }
     catch (Exception ex) {
       ExceptionUtils.marsh(ex);
       
       return null;
     } 
   }
 
 
 
 
   
   public String getCodeRemark() { return NCLangRes4VoTransl.getNCLangRes().getStrByID("4008009_0", "04008009-0018"); }
 
 
 
 
   
   private void setParameter(String key, Object val) {
     if (this.m_keyHas == null) {
       this.m_keyHas = new Hashtable();
     }
     if (val != null)
       this.m_keyHas.put(key, val); 
   }
 }